package com.etc.service.impl;

import com.etc.mapper.SightCommentDao;
import com.etc.pojo.SightComment;
import com.etc.pojo.SightDetail;
import com.etc.service.SightCommentService;
import com.etc.service.SightDetailService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sun.org.apache.xerces.internal.dom.CommentImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
class SightCommentImpl implements SightCommentService {
    @Autowired
    SightCommentDao dao;

    @Override
    public List<SightComment> selectAllSightComment() {
        return dao.queryAllSightComment();
    }

    @Override
    public int delSightComment(int sightId) {
        return dao.delSightComment();
    }

    @Override
    public PageInfo<SightComment> getAllSightCommentByPage(int pageNum, int pageSize) {
        //1.开始分页
        PageHelper.startPage(pageNum,pageSize);
        //2.执行查询所有用户信息
        List<SightComment> list=dao.queryAllSightComment();
        //3.通过pageInfo进行包装，pageInfo包含了非常丰富的分页属性
        PageInfo<SightComment> pageInfo = new PageInfo<SightComment>(list);
        return pageInfo;
    }


}
